package com.fu.core.service;

import com.fu.core.common.BusinessException;
import com.github.pagehelper.PageInfo;

import tk.mybatis.mapper.entity.Example;

import java.io.Serializable;
import java.util.List;

/**
 * @author 付龙江
 * @date 2022/1/27 21:32
 */
public interface BaseService<T> {
    PageInfo<T> selectTAll(Integer page, Integer num);

    PageInfo<T> selectAllOrVague(Integer page, Integer num, T... ts) throws IllegalAccessException, BusinessException;

    T selectByPk(Serializable id) throws BusinessException;

    PageInfo<T> selectByT(Integer page, Integer num, T t);

    T insertTSelective(T t) throws BusinessException;

    void deleteTByPk(Serializable t) throws BusinessException;

    void updateTByNewT(T t) throws BusinessException;

    PageInfo<T> selectTByExample(Integer page, Integer num, Example example);

    List<T> selectAll();

    T selectByFeatures(T t);

    PageInfo<T> selectAll(Integer page,Integer size, Example example);

    Integer updateByNewT(T t,Example example) throws BusinessException;

    /**
     * 更新或插入一条数据
     * @param t 要更新的对象
     * @return 返回执行成功的行数
     */
    Integer save(T t) throws Exception;
}
